<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
{{assign var="title" value='用户'}}
{{assign var="app" value='user'}}
{{assign var="act" value=''}}
<title>{{$title}} - {{'admin|admin_site_name'|C|default:'后台管理'}}</title>
{{include file="include/base.html"}}
{{include file="{{$smarty.const.PLUG}}chosen/chosen.html"}}

</head>
<body>

	{{include file="include/sidebar.html"}}
	
	<div class="body_right">
	<div id="content">
	
	<div class="search">
	  <ul class="bread">
		<li>◆ {{$title}}管理</li>
	  <ul>
	</div>
			
		<!--内容 S-->
		<form action="index.php?app={{$app}}&act=save" name="form1" class="form ajaxSubmit" method="post">
		<input type="hidden" name="id" value="{{$result.id}}">
		<table class="table table-bordered modify">
		  <tbody>
			<tr>
			  <td>用户名：</td>
			  <td>
			  	{{if $result.username==''}}
					<input name="username" type="text" value="{{$result.username}}"/> <span class="red">*</span>
					<br><span class="notice">不能有空格,允许中文/英文/数字,长度控制在3~15字符以内,不区分大小写</span>
			  	{{else}}
					<input name="id" type="hidden" value="{{$result.id}}"/>
					<input name="username" type="hidden" value="{{$result.username}}"/> 
					{{$result.username}}
			  	{{/if}}
			  </td>
			</tr>
			<tr>
			  <td>密码：</td>
			  <td>
			  	{{if !$result.id}}
			  		<input name="password" type="password" value=""/><!-- {{*新添加用户默认密码为: 123456*}} -->
			  	{{elseif $result.id>0}}
			  		<label class="checkbox inline"><input name="edit_password" type="checkbox" value="1"/>修改密码</label>
			  		<div class="password_div" style="display:none;">
						{{if 'role_id'|user!=1}}
						旧密码: <input name="oldpassword" type="password" value=""/><div style="padding-top:3px;"></div>
						{{/if}}
						新　密　码: <input name="newpassword1" type="password" value=""/><br/>
						确认新密码: <input name="newpassword2" type="password" value=""/>
			  		</div>
			  		<script>
						$(document).ready(function(){
							$("input[name='edit_password']").click(function(){
								if($(this).attr('checked')){
									$(".password_div").show();
								}else{
									$(".password_div").hide();
								}
							});
						});
					</script>
			  	{{/if}}
			  </td>
			</tr>
			<tr>
			  <td>邮箱：</td>
			  <td>
				<!-- 用户: --><input name="email" type="text" {{if $result.id>0}}readonly{{/if}} value="{{$result.email}}"/> 
				<span class="red">*</span>
				{{if !$result.id}}<span class="notice">(例:123456@qq.com)</span>{{/if}}
				{{if $result.id>0}}{{*编辑状态时一般不改变邮箱*}}
					<label class="checkbox inline"><input name="edit_email" type="checkbox" value="1"/>编辑邮箱</label>
					<script>
						$(document).ready(function(){
							$("input[name='edit_email']").click(function(){
								if($(this).attr('checked')){
									$("input[name='email']").attr("readonly",false);
								}else{
									$("input[name='email']").attr("readonly",true);
								}
							});
						});
					</script>
				{{/if}}
			  </td>
			</tr>
			<tr>
			  <td>角色：</td>
			  <td>
				<select name="role_id" class="chosen">
					<option value="">--角色--</option>
					{{html_options options=$roles selected=$result.role_id}}
				</select>
				<span class="red">*</span>
			  </td>
			</tr>
			{{include file="include/FORM1.html"}}{{*自定义表单*}}
		  </tbody>
		 </table>
		<div class="bottom_button">
			<button type="submit" class="btn btn-info"><i class="icon-ok icon-white"></i>确认</button>
		</div>
		</form>
		<!--内容 E-->
		
</div>
</div>

</body>
</html>